package com.example.project2;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;

import javax.sql.DataSource;


@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
@ServletComponentScan
@MapperScan("com.example.project2.mapper") // 指定 Mapper 接口扫描路径
@EnableCaching//注解缓存Redis启动
public class Project2Application {
	public static void main(String[] args) {
		ConfigurableApplicationContext context = SpringApplication.run(Project2Application.class, args);
		DataSource dataSource = (DataSource) context.getBean("dataSource");
		System.out.println(dataSource.getClass());
	}
}

